//
//  TPAppointDetailCell.m
//  Yimei
//
//  Created by xiaowu xiaowu on 2017/10/28.
//  Copyright © 2017年 xiaowu xiaowu. All rights reserved.
//

#import "TPAppointDetailCell.h"

@implementation TPAppointDetailCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]){
       
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self setup];
    }
    return self;
}
-(void)setup{
    
    self.date_label.textAlignment =self.title_label.textAlignment = NSTextAlignmentCenter;
    [self.date_label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15.0);
        make.bottom.mas_equalTo(0.0);
        make.height.mas_equalTo(20.0);
        make.width.mas_equalTo(self.mas_width).multipliedBy(0.49);
    }];
    [self.title_label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-10.0);
        make.bottom.mas_equalTo(self.date_label.mas_bottom);
        make.height.mas_equalTo(self.date_label.mas_height);
        make.width.mas_equalTo(self.date_label.mas_width);
    }];
    
    self.image_view.backgroundColor = TP_COLOR_240;
    [self.image_view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(0.0);
        make.height.mas_equalTo(50.0);
        make.width.mas_equalTo(1.0);
        make.left.mas_equalTo(23.0);
    }];
    
    self.detail_label.backgroundColor = TPAllBackgroundColor;
    [self.detail_label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-5.0);
        make.centerX.mas_equalTo(self.image_view);
        make.size.mas_equalTo(CGSizeMake(5.0, 5.0));
    }];
    ViewRadius(self.detail_label, 5/2);
    
}

-(void)setModel:(id)model{
    _model = model;
    self.date_label.text = [[NSDate date] stringFromDateWithFormat:kNSDateHelperFormatSQLDateWithTimeYYYYMMDDHHmmss];
    self.title_label.text = @"王明生";
}
@end
